package com.yunxin.core.domain.model.user;

/**
 * @author zero°
 * @since 2023-07-13
 */
public interface UserAuthRepository {

    /**
     * 保存
     * @param userAuth userAuth
     * @return boolean
     */
    boolean saveUserAuth(UserAuth userAuth);

    /**
     * 更新
     * @param userAuth userAuth
     * @return boolean
     */
    boolean updateUserAuth(UserAuth userAuth);

    /**
     * 根据唯一codeM5查询
     * @param identifierMd5 identifierMd5
     * @return UserAuth
     */
    UserAuth getUserAuthByIdentifierMd5(String identifierMd5);

    /**
     * 根据唯一code及主体查询
     * @param identifier identifier
     * @param authSubject authSubject
     * @return UserAuth
     */
    UserAuth getUserAuthByIdentifier(String identifier, String authSubject);

    /**
     * 根据用户code获取MD5、唯一标识
     * @param userCode
     * @return
     */
    UserAuth getVisitorIdByUserCode(String userCode);
}
